window.onload=function(){
	var a=$(".list_item_box input")
	$(".check li").eq(0).click(function(){
		a.attr("checked","checked")
	})
	$(".check li").eq(2).click(function(){
		a.prop("checked",false)
	})
	$(".check li").eq(1).click(function(){
		$.each(a, function(index) {
			if(a.eq(index).attr("checked")){
				a.eq(index).prop("checked",false)
			}else if(a.eq(index).attr("checked")!="checked"){
				a.eq(index).attr("checked","checked")
			}
		});
	})
	
	
	function fnTab(parent1,child1,parent2,child2,even){
		var dad1=document.getElementById(parent1)
		var son1=dad1.getElementsByTagName(child1);
		var dad2=document.getElementById(parent2)
		var son2=dad2.getElementsByTagName(child2);
		for(var i=0;i<son1.length;i++){
			son1[i].index=i;
			
			son1[i][even]=function(){
				
				for(var i=0;i<son1.length;i++){
					son1[i].className='';
					son2[i].className='item';
				}
				
				this.className='active';
				son2[this.index].className='show comList';	
			};	
		}
	}
	
	fnTab("click1","li","change1","ul","onclick")
	fnTab("click2","a","change2","div","onclick")
	fnTab("click3","li","change3","div","onclick")
	fnTab("click4","li","change4","ul","onclick")
	fnTab("click5","li","change5","div","onclick")
	fnTab("click6","li","change6","div","onclick")
	fnTab("click7","li","change7","div","onclick")
	fnTab("click8","li","change8","div","onclick")
	fnTab("click9","li","change9","div","onclick")
	fnTab("click10","li","change10","div","onclick")
	fnTab("click11","li","change11","div","onclick")
	fnTab("click12","li","change12","div","onclick")
	fnTab("click13","span","change13","div","onclick")
}
